/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = frfilter.h                                         */
/*  NOTE      =                                                    */
/*  DATE      = 2014/11/10 by guojq                                */
/*******************************************************************/

#ifndef __FRFILTER_H_
#define __FRFILTER_H_

#include "frlist.h"

#define FILTER_PROTO_ANY   0

unsigned long apm_filter_version(void);

Frlist_header *apm_get_filter_list(void);

//int apm_add_filter(int i_action, int i_accept, unsigned char arr_mac[APM_MAC_SIZE], u_short us_proto
//                , u_int ip_start, u_int ip_end
//                , u_short port_start, u_short port_end);

void apm_filter_remove_all(void);
int apm_filter_load(void *p_daq_hand, char **pp_result);
int apm_filter_init(void);
void apm_filter_destroy(void);

int apm_prepare_add(int i_action, int i_accept, const char *p_mac, u_short us_proto
              , const char *p_sip, const char *p_dip, const char *p_sport, const char *p_dport);
int apm_filter_show(char **pp_out);
void apm_filter_commit(char **pp_result);
void apm_filter_rollback(void);
int apm_filter_clear(void);
int apm_filter_clear_all(char **pp_result);

#endif
